### oefneing 4 ### public void onClick(View v) { try { num1 = Double.parseDouble(firstNumber.getText().toString()); num2 = Double.parseDouble(secondNumber.getText().toString()); div = num1 / num2; if (num2 == 0) { throw new ArithmeticException(); } else { addResult.setText(Double.toString(div)); } } catch (Exception e) { if (e instanceof NumberFormatException) { addResult.setText("Geen tekst a.u.b."); } else if (e instanceof ArithmeticException){ addResult.setText("Delen door 0 niet toegestaan!"); } else { addResult.setText(e.getMessage()); } } }